package com.cyc.quick.pojo.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.cyc.quick.util.BaseRegexPatterns;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author chenyunchang
 * @since 2021-01-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "SysUserAddVO对象", description = "SysUserAddVO对象")
public class SysUserAddVO extends Model<SysUserAddVO> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id", required = true)
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "真实姓名", required = true)
    @NotBlank(message = "真实姓名不可为空")
    private String realName;

    @ApiModelProperty(value = "性别 0: 女, 1: 男", required = true)
    @NotNull(message = "性别不可为空")
    private Integer sex;

    @ApiModelProperty(value = "身份证号", required = true)
    @NotBlank(message = "身份证号不可为空")
    private String idNo;

    @ApiModelProperty(value = "昵称", required = true)
    @NotBlank(message = "昵称不可为空")
    private String nickName;

    @ApiModelProperty(value = "手机号", required = true)
    @NotBlank(message = "手机号不可为空")
    @Pattern(regexp = BaseRegexPatterns.PHONE_REGEX,message = "手机号不符合规则！")
    private String phone;

    @ApiModelProperty(value = "密码", required = true)
    @NotBlank(message = "密码不可为空")
    private String password;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
